package com.shujia

import scala.collection.mutable
object Code30Set {
  def main(args: Array[String]): Unit = {

    /**
     * Set容器具有去重的功能,并且数据是无序的
     */

    val allSet: Set[Int] = Set(1, 2, 3, 1, 2, 3)
    println(allSet)

    val set: mutable.Set[Int] = mutable.Set(3, 4, 5, 3, 4, 5)

    set += 6
    println(set)

    val list: List[Int] = set.toList
    println(list)
    println(list.toSet)

    set -= 6
    println(set)

    val set1: mutable.Set[Int] = mutable.Set(7,7,8,8)

    println(set ++ set1)



  }
}
